//SPDX-FileCopyrightText: Copyright 2025-2025 深圳市同心圆网络有限公司
//SPDX-License-Identifier: GPL-3.0-only

import { invoke } from "@tauri-apps/api/core";


export type ServerConfigInfo = {
    can_user_register: boolean;
    quick_user_register: boolean;
}

export type GetServerConfigRequest = {};

export type GetServerConfigResponse = {
    config: ServerConfigInfo;
};

//获取远程服务器配置
export async function get_server_config(request: GetServerConfigRequest): Promise<GetServerConfigResponse> {
    const cmd = 'config_api_cmds_get_server_config';
    console.log(`%c${cmd}`, 'color:#0f0;', request);
    return invoke<GetServerConfigResponse>(cmd, {
        request,
    });
}